import http from "@/utils/request";

// 获取已读和未读消息
export const getMessagePage = async (data) => {
	return http.post<any>(`/member/message/get-page`,data)
}

// 修改用户手机
export const updateMobile = async (data) => {
	return http.post<any>(`/member/user/update-mobile`,data)
}

// 租户发帖
export const topicsCreate = async (data) => {
	return http.post<any>(`/member/topics-post/create`,data)
}

// 手机获得跟帖列表1最新2推荐
export const topicsGetPage = async (data) => {
	return http.post<any>(`/member/topics-post/get-page`,data)
}

// 手机获得话题列表
export const topicsPages = async (data) => {
	return http.post<any>(`/member/topics/get-page`,data)
}

// 查看话题详情
export const topicsInfo = async (id:number) => {
	return http.get<any>(`/member/topics/get-by-id/${id}`, {})
}

// 查看个人话题列表
export const topicsUserPage = async (data) => {
	return http.post<any>('/member/topics/get-page-by-user-id', data)
}

// 话题点赞
export const topicsUpvote = async (data) => {
	return http.post<any>(`/member/topics-post/add-like`, data)
}

// 租客填写问卷
export const questionAnswer = async (data) => {
	return http.post<any>(`/member/questionnaire-info/answer`, data)
}

// 预览问卷
export const questionInfo = async (id:number) => {
	return http.get<any>(`/member/questionnaire-info/preview-questionnaire/${id}`, {})
}

// 判断用户是否已经参加问卷调查
export const participateOrNot = async (data) => {
	return http.post<any>(`/member/questionnaire-info/participate/or/not`, data)
}

// 更新消息状态为已读
export const updateStatus = async (id:number) => {
	return http.get<any>(`/member/message/update-status/${id}`, {})
}

// 积分商城-获得登录信息加密信息和签文
export const getEncodeToken = async (data) => {
   return http.post<any>(`/member/points-mall/get-encode-token`, data)
}

// 查看历史反馈
export const feedbackList = async (data) => {
	return http.get<any>(`/member/member-feedback/historical-feedback`, data)
}

// 创建意见反馈
export const feedbackCreate = async (data) => {
   return http.post<any>(`/member/member-feedback/create`, data)
}
